<?php
$query = $_GET["query"];
$pattern = "/\s/";
$replacement = "%20";
$query = preg_replace($pattern, $replacement, $query);
$url = 'http://www-users.cs.umn.edu/~rnair/csci5980/YUIMaxiProject/proxy.cgi?action=parse&page='.$query.'&format=json';
$json = file_get_contents($url);
$data = json_decode($json, true);
$markup = $data["parse"]["text"]["*"];
$pattern = "/id=\"Rankings.*(<table.*<\/table>)/msU";
preg_match($pattern, $markup, $matches);
echo $matches[1];


?>
